From: Liu, Jinsong Date: Thu, 15 Dec 2011 09:58:53 +0000 (+0100) Subject: x86/MCE: add more strict sanity check of one SRAR case X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=1cf8a44e39c5b21cfe67ddb61fe2b91b807443c6;p=xen.git x86/MCE: add more strict sanity check of one SRAR case When RIPV = EIPV = 0, it's a little bit tricky. It may be an asynchronic error, currently we have no way to precisely locate whether the error occur at guest or hypervisor. To avoid handling error in wrong way, we treat it as unrecovered. Signed-off-by: Liu, Jinsong Signed-off-by: Jan Beulich Committed-by: Jan Beulich --- diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c index 1b941f41e3..0986025a8d 100644 --- a/xen/arch/x86/cpu/mcheck/mce_intel.c +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -375,8 +375,18 @@ static int mce_urgent_action(struct cpu_user_regs *regs, return 0; gstatus = mca_rdmsr(MSR_IA32_MCG_STATUS); - /* Xen is not pre-emptible */ - if ( !(gstatus & MCG_STATUS_RIPV) && !guest_mode(regs)) + + /* + * FIXME: When RIPV = EIPV = 0, it's a little bit tricky. It may be an + * asynchronic error, currently we have no way to precisely locate + * whether the error occur at guest or hypervisor. + * To avoid handling error in wrong way, we treat it as unrecovered. + * + * Another unrecovered case is RIPV = 0 while in hypervisor + * since Xen is not pre-emptible. + */ + if ( !(gstatus & MCG_STATUS_RIPV) && + (!(gstatus & MCG_STATUS_EIPV) || !guest_mode(regs)) ) return -1; return mce_action(regs, mctc) == MCER_RESET ? -1 : 0;